package com.cloudOffice.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloudOffice.result.Result;
import com.cloudOffice.service.OaProcessService;
import com.cloudOffice.vo.process.ProcessQueryVo;
import com.cloudOffice.vo.process.ProcessVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 审批类型
 */
@Slf4j
@Tag(name = "审批类型")
@RestController("OaProcessController")
@RequestMapping("/admin/process")
public class OaProcessController {
	
	@Resource
	private OaProcessService processService;
	
	//审批管理列表
	@Operation(summary = "获取分页列表")
	@GetMapping("{page}/{limit}")
	public Result<IPage<ProcessVo>> index(@PathVariable Long page,
	                                      @PathVariable Long limit,
	                                      ProcessQueryVo processQueryVo) {
		log.info("审批管理列表：processQueryVo: {}", processQueryVo);
		Page<ProcessVo> pageParam = new Page<>(page, limit);
		return Result.success(processService.selectPage(pageParam, processQueryVo));
	}
}

